import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { ConnectedRouter } from 'react-router-redux';
import { Route } from 'react-router-dom';

import store from '../store';
import history from '../history';
import AsyncComponent from './common/AsyncComponent';

// 健康报相关
const Health = AsyncComponent(() => import('./PBM3/Health'));
const HealthClass = AsyncComponent(() => import('./HealthClass'));
const HealthNewsPage = AsyncComponent(() => import('./HealthClass/healthNewsPage.js'))
const HealthPhysical = AsyncComponent(() => import('./HealthPhysical'));

class App extends Component {
    render() {
        return <Provider store={store}>
            <ConnectedRouter history={this.props.history || history}>
                <div className="weixin-content">
                    <div className="weixin-content">
                        <Route exact path='/health' component={Health} />
                        <Route exact path='/healthClass' component={HealthClass} />
                        <Route exact path='/healthNewsPage' component={HealthNewsPage} />
                        <Route exact path='/healthPhysical' component={HealthPhysical} />
                    </div>
                </div>
            </ConnectedRouter>
        </Provider>;
    }
}
export default App;
